package com.example.security2.controller;

import com.example.security2.pojo.LoginVO;
import com.example.security2.pojo.Result;
import com.example.security2.service.LoginService;
import jakarta.annotation.Resource;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
/*    @Resource
    private UserDetailsService   userDetailsService;*/
    @Resource
    private LoginService loginService;


    @PostMapping("/login")
    public Result login(@RequestBody LoginVO loginVO){
        Result result = loginService.login(loginVO);
        return result;
    }
}
